
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>D.7 thread头文件 · C++并发编程实战（第2版）</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="陈晓伟 chenxiaowei">
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="D.6-chinese.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../Praise_for_the_first_edition.html">
            
                <a href="../Praise_for_the_first_edition.html">
            
                    
                    第一版的赞许
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../preface-chinese.html">
            
                <a href="../preface-chinese.html">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../acknowledgments-chinese.html">
            
                <a href="../acknowledgments-chinese.html">
            
                    
                    感谢
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../about_this_book-chinese.html">
            
                <a href="../about_this_book-chinese.html">
            
                    
                    关于本书
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../about_the_author-chinese.html">
            
                <a href="../about_the_author-chinese.html">
            
                    
                    关于作者
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../about_cover_illustration-chinese.html">
            
                <a href="../about_cover_illustration-chinese.html">
            
                    
                    关于封面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../chapter1/1.0-chinese.html">
            
                <a href="../chapter1/1.0-chinese.html">
            
                    
                    第1章 你好，并发世界
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../chapter1/1.1-chinese.html">
            
                <a href="../chapter1/1.1-chinese.html">
            
                    
                    1.1 何谓并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../chapter1/1.2-chinese.html">
            
                <a href="../chapter1/1.2-chinese.html">
            
                    
                    1.2 为什么使用并发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../chapter1/1.3-chinese.html">
            
                <a href="../chapter1/1.3-chinese.html">
            
                    
                    1.3 并发和多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="../chapter1/1.4-chinese.html">
            
                <a href="../chapter1/1.4-chinese.html">
            
                    
                    1.4 开始入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="../chapter1/1.5-chinese.html">
            
                <a href="../chapter1/1.5-chinese.html">
            
                    
                    1.5 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../chapter2/2.0-chinese.html">
            
                <a href="../chapter2/2.0-chinese.html">
            
                    
                    第2章 线程管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../chapter2/2.1-chinese.html">
            
                <a href="../chapter2/2.1-chinese.html">
            
                    
                    2.1 线程的基本操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../chapter2/2.2-chinese.html">
            
                <a href="../chapter2/2.2-chinese.html">
            
                    
                    2.2 传递参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../chapter2/2.3-chinese.html">
            
                <a href="../chapter2/2.3-chinese.html">
            
                    
                    2.3 转移所有权
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../chapter2/2.4-chinese.html">
            
                <a href="../chapter2/2.4-chinese.html">
            
                    
                    2.4 确定线程数量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../chapter2/2.5-chinese.html">
            
                <a href="../chapter2/2.5-chinese.html">
            
                    
                    2.5 线程标识
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../chapter2/2.6-chinese.html">
            
                <a href="../chapter2/2.6-chinese.html">
            
                    
                    2.6 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../chapter3/3.0-chinese.html">
            
                <a href="../chapter3/3.0-chinese.html">
            
                    
                    第3章 共享数据
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../chapter3/3.1-chinese.html">
            
                <a href="../chapter3/3.1-chinese.html">
            
                    
                    3.1 共享数据的问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../chapter3/3.2-chinese.html">
            
                <a href="../chapter3/3.2-chinese.html">
            
                    
                    3.2 使用互斥量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../chapter3/3.3-chinese.html">
            
                <a href="../chapter3/3.3-chinese.html">
            
                    
                    3.3 保护共享数据的方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../chapter3/3.4-chinese.html">
            
                <a href="../chapter3/3.4-chinese.html">
            
                    
                    3.4 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../chapter4/4.0-chinese.html">
            
                <a href="../chapter4/4.0-chinese.html">
            
                    
                    第4章 同步操作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../chapter4/4.1-chinese.html">
            
                <a href="../chapter4/4.1-chinese.html">
            
                    
                    4.1 等待事件或条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../chapter4/4.2-chinese.html">
            
                <a href="../chapter4/4.2-chinese.html">
            
                    
                    4.2 使用future
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../chapter4/4.3-chinese.html">
            
                <a href="../chapter4/4.3-chinese.html">
            
                    
                    4.3 限时等待
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../chapter4/4.4-chinese.html">
            
                <a href="../chapter4/4.4-chinese.html">
            
                    
                    4.4 简化代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../chapter4/4.5-chinese.html">
            
                <a href="../chapter4/4.5-chinese.html">
            
                    
                    4.5 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../chapter5/5.0-chinese.html">
            
                <a href="../chapter5/5.0-chinese.html">
            
                    
                    第5章 内存模型和原子操作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../chapter5/5.1-chinese.html">
            
                <a href="../chapter5/5.1-chinese.html">
            
                    
                    5.1 内存模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.2" data-path="../chapter5/5.2-chinese.html">
            
                <a href="../chapter5/5.2-chinese.html">
            
                    
                    5.2 原子操作和原子类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.3" data-path="../chapter5/5.3-chinese.html">
            
                <a href="../chapter5/5.3-chinese.html">
            
                    
                    5.3 同步操作和强制排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12.4" data-path="../chapter5/5.4-chinese.html">
            
                <a href="../chapter5/5.4-chinese.html">
            
                    
                    5.4 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../chapter6/6.0-chinese.html">
            
                <a href="../chapter6/6.0-chinese.html">
            
                    
                    第6章 设计基于锁的并发数据结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../chapter6/6.1-chinese.html">
            
                <a href="../chapter6/6.1-chinese.html">
            
                    
                    6.1 并发设计的意义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../chapter6/6.2-chinese.html">
            
                <a href="../chapter6/6.2-chinese.html">
            
                    
                    6.2 基于锁的并发数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../chapter6/6.3-chinese.html">
            
                <a href="../chapter6/6.3-chinese.html">
            
                    
                    6.3 设计更加复杂的数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../chapter6/6.4-chinese.html">
            
                <a href="../chapter6/6.4-chinese.html">
            
                    
                    6.4 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../chapter7/7.0-chinese.html">
            
                <a href="../chapter7/7.0-chinese.html">
            
                    
                    第7章 设计无锁的并发数据结构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../chapter7/7.1-chinese.html">
            
                <a href="../chapter7/7.1-chinese.html">
            
                    
                    7.1 定义和意义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../chapter7/7.2-chinese.html">
            
                <a href="../chapter7/7.2-chinese.html">
            
                    
                    7.2 无锁数据结构的例子
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../chapter7/7.3-chinese.html">
            
                <a href="../chapter7/7.3-chinese.html">
            
                    
                    7.3 设计无锁数据结构的指导建议
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../chapter7/7.4-chinese.html">
            
                <a href="../chapter7/7.4-chinese.html">
            
                    
                    7.4 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../chapter8/8.0-chinese.html">
            
                <a href="../chapter8/8.0-chinese.html">
            
                    
                    第8章 并发设计
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../chapter8/8.1-chinese.html">
            
                <a href="../chapter8/8.1-chinese.html">
            
                    
                    8.1 线程间划分工作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../chapter8/8.2-chinese.html">
            
                <a href="../chapter8/8.2-chinese.html">
            
                    
                    8.2 并发代码的性能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../chapter8/8.3-chinese.html">
            
                <a href="../chapter8/8.3-chinese.html">
            
                    
                    8.3 为多线程性能设计数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../chapter8/8.4-chinese.html">
            
                <a href="../chapter8/8.4-chinese.html">
            
                    
                    8.4 设计并发代码的注意事项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.5" data-path="../chapter8/8.5-chinese.html">
            
                <a href="../chapter8/8.5-chinese.html">
            
                    
                    8.5 在实践中设计并发代码
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.6" data-path="../chapter8/8.6-chinese.html">
            
                <a href="../chapter8/8.6-chinese.html">
            
                    
                    8.6 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.16" data-path="../chapter9/9.0-chinese.html">
            
                <a href="../chapter9/9.0-chinese.html">
            
                    
                    第9章 高级线程管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.16.1" data-path="../chapter9/9.1-chinese.html">
            
                <a href="../chapter9/9.1-chinese.html">
            
                    
                    9.1 线程池
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.2" data-path="../chapter9/9.2-chinese.html">
            
                <a href="../chapter9/9.2-chinese.html">
            
                    
                    9.2 中断线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.16.3" data-path="../chapter9/9.3-chinese.html">
            
                <a href="../chapter9/9.3-chinese.html">
            
                    
                    9.3 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.17" data-path="../chapter10/10.0-chinese.html">
            
                <a href="../chapter10/10.0-chinese.html">
            
                    
                    第10章 并行算法
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.17.1" data-path="../chapter10/10.1-chinese.html">
            
                <a href="../chapter10/10.1-chinese.html">
            
                    
                    10.1 并行化标准库算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.2" data-path="../chapter10/10.2-chinese.html">
            
                <a href="../chapter10/10.2-chinese.html">
            
                    
                    10.2 执行策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.3" data-path="../chapter10/10.3-chinese.html">
            
                <a href="../chapter10/10.3-chinese.html">
            
                    
                    10.3 C++标准库中的并行算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.17.4" data-path="../chapter10/10.4-chinese.html">
            
                <a href="../chapter10/10.4-chinese.html">
            
                    
                    10.4 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.18" data-path="../chapter11/11.0-chinese.html">
            
                <a href="../chapter11/11.0-chinese.html">
            
                    
                    第11章 测试和调试多线程应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.18.1" data-path="../chapter11/11.1-chinese.html">
            
                <a href="../chapter11/11.1-chinese.html">
            
                    
                    11.1 与并发相关的Bug
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.2" data-path="../chapter11/11.2-chinese.html">
            
                <a href="../chapter11/11.2-chinese.html">
            
                    
                    11.2 定位并发Bug的技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.18.3" data-path="../chapter11/11.3-chinese.html">
            
                <a href="../chapter11/11.3-chinese.html">
            
                    
                    11.3 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.19" data-path="../appendix_A/A.0-chinese.html">
            
                <a href="../appendix_A/A.0-chinese.html">
            
                    
                    附录A C++11特性简明参考(部分)
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.19.1" data-path="../appendix_A/A.1-chinese.html">
            
                <a href="../appendix_A/A.1-chinese.html">
            
                    
                    A.1 右值引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.2" data-path="../appendix_A/A.2-chinese.html">
            
                <a href="../appendix_A/A.2-chinese.html">
            
                    
                    A.2 删除函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.3" data-path="../appendix_A/A.3-chinese.html">
            
                <a href="../appendix_A/A.3-chinese.html">
            
                    
                    A.3 默认函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.4" data-path="../appendix_A/A.4-chinese.html">
            
                <a href="../appendix_A/A.4-chinese.html">
            
                    
                    A.4 常量表达式函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.5" data-path="../appendix_A/A.5-chinese.html">
            
                <a href="../appendix_A/A.5-chinese.html">
            
                    
                    A.5 Lambda函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.6" data-path="../appendix_A/A.6-chinese.html">
            
                <a href="../appendix_A/A.6-chinese.html">
            
                    
                    A.6 变参模板
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.7" data-path="../appendix_A/A.7-chinese.html">
            
                <a href="../appendix_A/A.7-chinese.html">
            
                    
                    A.7 自动推导变量类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.8" data-path="../appendix_A/A.8-chinese.html">
            
                <a href="../appendix_A/A.8-chinese.html">
            
                    
                    A.8 线程本地变量
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.9" data-path="../appendix_A/A.9-chinese.html">
            
                <a href="../appendix_A/A.9-chinese.html">
            
                    
                    A.9 模板类参数的推导
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.19.10" data-path="../appendix_A/A.10-chinese.html">
            
                <a href="../appendix_A/A.10-chinese.html">
            
                    
                    A.10 本章总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.20" data-path="../appendix_B/B.0-chinese.html">
            
                <a href="../appendix_B/B.0-chinese.html">
            
                    
                    附录B 并发库简要对比
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.21" data-path="../appendix_C/C.0-chinese.html">
            
                <a href="../appendix_C/C.0-chinese.html">
            
                    
                    附录C 消息传递框架与完整的ATM示例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22" data-path="D.0-chinese.html">
            
                <a href="D.0-chinese.html">
            
                    
                    附录D C++线程类库参考
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.22.1" data-path="D.1-chinese.html">
            
                <a href="D.1-chinese.html">
            
                    
                    D.1 chrono头文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22.2" data-path="D.2-chinese.html">
            
                <a href="D.2-chinese.html">
            
                    
                    D.2 condition_variable头文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22.3" data-path="D.3-chinese.html">
            
                <a href="D.3-chinese.html">
            
                    
                    D.3 atomic头文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22.4" data-path="D.4-chinese.html">
            
                <a href="D.4-chinese.html">
            
                    
                    D.4 future头文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22.5" data-path="D.5-chinese.html">
            
                <a href="D.5-chinese.html">
            
                    
                    D.5 mutex头文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.22.6" data-path="D.6-chinese.html">
            
                <a href="D.6-chinese.html">
            
                    
                    D.6 ratio头文件
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.22.7" data-path="D.7-chinese.html">
            
                <a href="D.7-chinese.html">
            
                    
                    D.7 thread头文件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >D.7 thread头文件</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="d7-thread&#x5934;&#x6587;&#x4EF6;">D.7 &lt;thread&gt;&#x5934;&#x6587;&#x4EF6;</h1>
<p><code>&lt;thread&gt;</code>&#x5934;&#x6587;&#x4EF6;&#x63D0;&#x4F9B;&#x4E86;&#x7BA1;&#x7406;&#x548C;&#x8FA8;&#x522B;&#x7EBF;&#x7A0B;&#x7684;&#x5DE5;&#x5177;&#xFF0C;&#x5E76;&#x4E14;&#x63D0;&#x4F9B;&#x51FD;&#x6570;&#xFF0C;&#x53EF;&#x8BA9;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x4F11;&#x7720;&#x3002;</p>
<p><strong>&#x5934;&#x6587;&#x4EF6;&#x5185;&#x5BB9;</strong></p>
<pre><code>namespace std
{
  class thread;

  namespace this_thread
  {
    thread::id get_id() noexcept;

    void yield() noexcept;

    template&lt;typename Rep,typename Period&gt;
    void sleep_for(
        std::chrono::duration&lt;Rep,Period&gt; sleep_duration);

    template&lt;typename Clock,typename Duration&gt;
    void sleep_until(
        std::chrono::time_point&lt;Clock,Duration&gt; wake_time);
  }
}
</code></pre><h2 id="d71-stdthread&#x7C7B;">D.7.1 std::thread&#x7C7B;</h2>
<p><code>std::thread</code>&#x7528;&#x6765;&#x7BA1;&#x7406;&#x7EBF;&#x7A0B;&#x7684;&#x6267;&#x884C;&#x3002;&#x5176;&#x63D0;&#x4F9B;&#x8BA9;&#x65B0;&#x7684;&#x7EBF;&#x7A0B;&#x6267;&#x884C;&#x6216;&#x6267;&#x884C;&#xFF0C;&#x4E5F;&#x63D0;&#x4F9B;&#x5BF9;&#x7EBF;&#x7A0B;&#x7684;&#x8BC6;&#x522B;&#xFF0C;&#x4EE5;&#x53CA;&#x63D0;&#x4F9B;&#x5176;&#x4ED6;&#x51FD;&#x6570;&#x7528;&#x4E8E;&#x7BA1;&#x7406;&#x7EBF;&#x7A0B;&#x7684;&#x6267;&#x884C;&#x3002;</p>
<pre><code>class thread
{
public:
  // Types
  class id;
  typedef implementation-defined native_handle_type; // optional

  // Construction and Destruction
  thread() noexcept;
  ~thread();

  template&lt;typename Callable,typename Args...&gt;
  explicit thread(Callable&amp;&amp; func,Args&amp;&amp;... args);

  // Copying and Moving
  thread(thread const&amp; other) = delete;
  thread(thread&amp;&amp; other) noexcept;

  thread&amp; operator=(thread const&amp; other) = delete;
  thread&amp; operator=(thread&amp;&amp; other) noexcept;

  void swap(thread&amp; other) noexcept;

  void join();
  void detach();
  bool joinable() const noexcept;

  id get_id() const noexcept;
  native_handle_type native_handle();
  static unsigned hardware_concurrency() noexcept;
};

void swap(thread&amp; lhs,thread&amp; rhs);
</code></pre><h3 id="stdthreadid-&#x7C7B;">std::thread::id &#x7C7B;</h3>
<p>&#x53EF;&#x4EE5;&#x901A;&#x8FC7;<code>std::thread::id</code>&#x5B9E;&#x4F8B;&#x5BF9;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x8FDB;&#x884C;&#x8BC6;&#x522B;&#x3002;</p>
<p><strong>&#x7C7B;&#x578B;&#x5B9A;&#x4E49;</strong></p>
<pre><code>class thread::id
{
public:
  id() noexcept;
};

bool operator==(thread::id x, thread::id y) noexcept;
bool operator!=(thread::id x, thread::id y) noexcept;
bool operator&lt;(thread::id x, thread::id y) noexcept;
bool operator&lt;=(thread::id x, thread::id y) noexcept;
bool operator&gt;(thread::id x, thread::id y) noexcept;
bool operator&gt;=(thread::id x, thread::id y) noexcept;

template&lt;typename charT, typename traits&gt;
basic_ostream&lt;charT, traits&gt;&amp;
operator&lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp;&amp; out, thread::id id);
</code></pre><p><strong>Notes</strong>
<code>std::thread::id</code>&#x7684;&#x503C;&#x53EF;&#x4EE5;&#x8BC6;&#x522B;&#x4E0D;&#x540C;&#x7684;&#x6267;&#x884C;&#xFF0C;&#x6BCF;&#x4E2A;<code>std::thread::id</code>&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FA;&#x6765;&#x7684;&#x503C;&#x90FD;&#x4E0D;&#x4E00;&#x6837;&#xFF0C;&#x4E0D;&#x540C;&#x503C;&#x4EE3;&#x8868;&#x4E0D;&#x540C;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><code>std::thread::id</code>&#x7684;&#x503C;&#x662F;&#x4E0D;&#x53EF;&#x9884;&#x6D4B;&#x7684;&#xFF0C;&#x5728;&#x540C;&#x4E00;&#x7A0B;&#x5E8F;&#x4E2D;&#x7684;&#x4E0D;&#x540C;&#x7EBF;&#x7A0B;&#x7684;id&#x4E5F;&#x4E0D;&#x540C;&#x3002;</p>
<p><code>std::thread::id</code>&#x662F;&#x53EF;&#x4EE5;CopyConstructible(&#x62F7;&#x8D1D;&#x6784;&#x9020;)&#x548C;CopyAssignable(&#x62F7;&#x8D1D;&#x8D4B;&#x503C;)&#xFF0C;&#x6240;&#x4EE5;&#x5BF9;&#x4E8E;<code>std::thread::id</code>&#x7684;&#x62F7;&#x8D1D;&#x548C;&#x8D4B;&#x503C;&#x662F;&#x6CA1;&#x6709;&#x9650;&#x5236;&#x7684;&#x3002;</p>
<h4 id="stdthreadid-&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FD;&#x6570;">std::thread::id &#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FD;&#x6570;</h4>
<p>&#x6784;&#x9020;&#x4E00;&#x4E2A;<code>std::thread::id</code>&#x5BF9;&#x8C61;&#xFF0C;&#x5176;&#x4E0D;&#x80FD;&#x8868;&#x793A;&#x4EFB;&#x4F55;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>id() noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x6784;&#x9020;&#x4E00;&#x4E2A;<code>std::thread::id</code>&#x5B9E;&#x4F8B;&#xFF0C;&#x4E0D;&#x80FD;&#x8868;&#x793A;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x503C;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<p><strong>NOTE</strong> &#x6240;&#x6709;&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x7684;<code>std::thread::id</code>&#x5B9E;&#x4F8B;&#x5B58;&#x50A8;&#x7684;&#x540C;&#x4E00;&#x4E2A;&#x503C;&#x3002;</p>
<h4 id="stdthreadid-&#x76F8;&#x7B49;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;">std::thread::id &#x76F8;&#x7B49;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;</h4>
<p>&#x6BD4;&#x8F83;&#x4E24;&#x4E2A;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x770B;&#x662F;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x662F;&#x5426;&#x76F8;&#x7B49;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool operator==(std::thread::id lhs,std::thread::id rhs) noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
&#x5F53;lhs&#x548C;rhs&#x8868;&#x793A;&#x540C;&#x4E00;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x6216;&#x4E24;&#x8005;&#x4E0D;&#x4EE3;&#x8868;&#x6CA1;&#x6709;&#x4EFB;&#x4F55;&#x7EBF;&#x7A0B;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;true&#x3002;&#x5F53;lsh&#x548C;rhs&#x8868;&#x793A;&#x4E0D;&#x540C;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x6216;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x4EE3;&#x8868;&#x4E00;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#xFF0C;&#x53E6;&#x4E00;&#x4E2A;&#x4E0D;&#x4EE3;&#x8868;&#x4EFB;&#x4F55;&#x7EBF;&#x7A0B;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;false&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h4 id="stdthreadid-&#x4E0D;&#x76F8;&#x7B49;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;">std::thread::id &#x4E0D;&#x76F8;&#x7B49;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;</h4>
<p>&#x6BD4;&#x8F83;&#x4E24;&#x4E2A;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x770B;&#x662F;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x662F;&#x5426;&#x76F8;&#x7B49;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool operator&#xFF01;=(std::thread::id lhs,std::thread::id rhs) noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
<code>!(lhs==rhs)</code></p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h4 id="stdthreadid-&#x5C0F;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;">std::thread::id &#x5C0F;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;</h4>
<p>&#x6BD4;&#x8F83;&#x4E24;&#x4E2A;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x770B;&#x662F;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x54EA;&#x4E2A;&#x5148;&#x6267;&#x884C;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool operator&lt;(std::thread::id lhs,std::thread::id rhs) noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
&#x5F53;lhs&#x6BD4;rhs&#x7684;&#x7EBF;&#x7A0B;ID&#x9760;&#x524D;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;true&#x3002;&#x5F53;lhs!=rhs&#xFF0C;&#x4E14;<code>lhs&lt;rhs</code>&#x6216;<code>rhs&lt;lhs</code>&#x8FD4;&#x56DE;true&#xFF0C;&#x5176;&#x4ED6;&#x60C5;&#x51B5;&#x5219;&#x8FD4;&#x56DE;false&#x3002;&#x5F53;lhs==rhs&#xFF0C;&#x5728;<code>lhs&lt;rhs</code>&#x548C;<code>rhs&lt;lhs</code>&#x65F6;&#x8FD4;&#x56DE;false&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<p><strong>NOTE</strong> &#x5F53;&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x7684;<code>std::thread::id</code>&#x5B9E;&#x4F8B;&#xFF0C;&#x5728;&#x4E0D;&#x4EE3;&#x8868;&#x4EFB;&#x4F55;&#x7EBF;&#x7A0B;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x5176;&#x503C;&#x5C0F;&#x4E8E;&#x4EFB;&#x4F55;&#x4E00;&#x4E2A;&#x4EE3;&#x8868;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x7684;&#x5B9E;&#x4F8B;&#x3002;&#x5F53;&#x4E24;&#x4E2A;&#x5B9E;&#x4F8B;&#x76F8;&#x7B49;&#xFF0C;&#x90A3;&#x4E48;&#x4E24;&#x4E2A;&#x5BF9;&#x8C61;&#x4EE3;&#x8868;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;&#x4EFB;&#x4F55;&#x4E00;&#x7EC4;&#x4E0D;&#x540C;&#x7684;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x662F;&#x7531;&#x540C;&#x4E00;&#x5E8F;&#x5217;&#x6784;&#x9020;&#xFF0C;&#x8FD9;&#x4E0E;&#x7A0B;&#x5E8F;&#x6267;&#x884C;&#x7684;&#x987A;&#x5E8F;&#x76F8;&#x540C;&#x3002;&#x540C;&#x4E00;&#x4E2A;&#x53EF;&#x6267;&#x884C;&#x7A0B;&#x5E8F;&#x53EF;&#x80FD;&#x6709;&#x4E0D;&#x540C;&#x7684;&#x6267;&#x884C;&#x987A;&#x5E8F;&#x3002;</p>
<h4 id="stdthreadid-&#x5C0F;&#x4E8E;&#x7B49;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;">std::thread::id &#x5C0F;&#x4E8E;&#x7B49;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;</h4>
<p>&#x6BD4;&#x8F83;&#x4E24;&#x4E2A;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x770B;&#x662F;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x7684;ID&#x503C;&#x662F;&#x5426;&#x76F8;&#x7B49;&#xFF0C;&#x6216;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x5148;&#x884C;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool operator&lt;(std::thread::id lhs,std::thread::id rhs) noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
<code>!(rhs&lt;lhs)</code></p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h4 id="stdthreadid-&#x5927;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;">std::thread::id &#x5927;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;</h4>
<p>&#x6BD4;&#x8F83;&#x4E24;&#x4E2A;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x770B;&#x662F;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x7684;&#x662F;&#x540E;&#x884C;&#x7684;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool operator&gt;(std::thread::id lhs,std::thread::id rhs) noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
<code>rhs&lt;lhs</code></p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h4 id="stdthreadid-&#x5927;&#x4E8E;&#x7B49;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;">std::thread::id &#x5927;&#x4E8E;&#x7B49;&#x4E8E;&#x6BD4;&#x8F83;&#x64CD;&#x4F5C;</h4>
<p>&#x6BD4;&#x8F83;&#x4E24;&#x4E2A;<code>std::thread::id</code>&#x7684;&#x503C;&#xFF0C;&#x770B;&#x662F;&#x4E24;&#x4E2A;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x7684;ID&#x503C;&#x662F;&#x5426;&#x76F8;&#x7B49;&#xFF0C;&#x6216;&#x5176;&#x4E2D;&#x4E00;&#x4E2A;&#x540E;&#x884C;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool operator&gt;=(std::thread::id lhs,std::thread::id rhs) noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
<code>!(lhs&lt;rhs)</code></p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h4 id="stdthreadid-&#x63D2;&#x5165;&#x6D41;&#x64CD;&#x4F5C;">std::thread::id &#x63D2;&#x5165;&#x6D41;&#x64CD;&#x4F5C;</h4>
<p>&#x5C06;<code>std::thread::id</code>&#x7684;&#x503C;&#x901A;&#x8FC7;&#x7ED9;&#x6307;&#x5B9A;&#x6D41;&#x5199;&#x5165;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>template&lt;typename charT, typename traits&gt;
basic_ostream&lt;charT, traits&gt;&amp;
operator&lt;&lt; (basic_ostream&lt;charT, traits&gt;&amp;&amp; out, thread::id id);
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x5C06;<code>std::thread::id</code>&#x7684;&#x503C;&#x901A;&#x8FC7;&#x7ED9;&#x6307;&#x5B9A;&#x6D41;&#x63D2;&#x5165;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<p><strong>&#x8FD4;&#x56DE;</strong>
&#x65E0;</p>
<p><strong>NOTE</strong> &#x5B57;&#x7B26;&#x4E32;&#x7684;&#x683C;&#x5F0F;&#x5E76;&#x672A;&#x7ED9;&#x5B9A;&#x3002;<code>std::thread::id</code>&#x5B9E;&#x4F8B;&#x5177;&#x6709;&#x76F8;&#x540C;&#x7684;&#x8868;&#x8FBE;&#x5F0F;&#x65F6;&#xFF0C;&#x662F;&#x76F8;&#x540C;&#x7684;&#xFF1B;&#x5F53;&#x5B9E;&#x4F8B;&#x8868;&#x8FBE;&#x5F0F;&#x4E0D;&#x540C;&#xFF0C;&#x5219;&#x4EE3;&#x8868;&#x4E0D;&#x540C;&#x7684;&#x7EBF;&#x7A0B;&#x3002;</p>
<h3 id="stdthreadnativehandler-&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::native_handler &#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p><code>native_handle_type</code>&#x662F;&#x7531;&#x53E6;&#x4E00;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x800C;&#x6765;&#xFF0C;&#x8FD9;&#x4E2A;&#x7C7B;&#x578B;&#x4F1A;&#x968F;&#x7740;&#x6307;&#x5B9A;&#x5E73;&#x53F0;&#x7684;API&#x800C;&#x53D8;&#x5316;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>typedef implementation-defined native_handle_type;
</code></pre><p><strong>NOTE</strong> &#x8FD9;&#x4E2A;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x662F;&#x53EF;&#x9009;&#x7684;&#x3002;&#x5982;&#x679C;&#x63D0;&#x4F9B;&#xFF0C;&#x5B9E;&#x73B0;&#x5C06;&#x4F7F;&#x7528;&#x539F;&#x751F;&#x5E73;&#x53F0;&#x6307;&#x5B9A;&#x7684;API&#xFF0C;&#x5E76;&#x63D0;&#x4F9B;&#x5408;&#x9002;&#x7684;&#x7C7B;&#x578B;&#x4F5C;&#x4E3A;&#x5B9E;&#x73B0;&#x3002;</p>
<h3 id="stdthread-&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FD;&#x6570;">std::thread &#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x51FD;&#x6570;</h3>
<p>&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;<code>native_handle_type</code>&#x7C7B;&#x578B;&#x7684;&#x503C;&#xFF0C;&#x8FD9;&#x4E2A;&#x503C;&#x53EF;&#x4EE5;&#x53EF;&#x4EE5;&#x8868;&#x793A;*this&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>native_handle_type native_handle();
</code></pre><p><strong>NOTE</strong> &#x8FD9;&#x4E2A;&#x51FD;&#x6570;&#x662F;&#x53EF;&#x9009;&#x7684;&#x3002;&#x5982;&#x679C;&#x63D0;&#x4F9B;&#xFF0C;&#x4F1A;&#x4F7F;&#x7528;&#x539F;&#x751F;&#x5E73;&#x53F0;&#x6307;&#x5B9A;&#x7684;API&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x5408;&#x9002;&#x7684;&#x503C;&#x3002;</p>
<h3 id="stdthread-&#x6784;&#x9020;&#x51FD;&#x6570;">std::thread &#x6784;&#x9020;&#x51FD;&#x6570;</h3>
<p>&#x6784;&#x9020;&#x4E00;&#x4E2A;&#x65E0;&#x76F8;&#x5173;&#x7EBF;&#x7A0B;&#x7684;<code>std::thread</code>&#x5BF9;&#x8C61;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>thread() noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x6784;&#x9020;&#x4E00;&#x4E2A;&#x65E0;&#x76F8;&#x5173;&#x7EBF;&#x7A0B;&#x7684;<code>std::thread</code>&#x5B9E;&#x4F8B;&#x3002;</p>
<p><strong>&#x540E;&#x7F6E;&#x6761;&#x4EF6;</strong>
&#x5BF9;&#x4E8E;&#x4E00;&#x4E2A;&#x65B0;&#x6784;&#x9020;&#x7684;<code>std::thread</code>&#x5BF9;&#x8C61;x&#xFF0C;x.get_id() == id()&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="stdthread-&#x79FB;&#x52A8;&#x6784;&#x9020;&#x51FD;&#x6570;">std::thread &#x79FB;&#x52A8;&#x6784;&#x9020;&#x51FD;&#x6570;</h3>
<p>&#x5C06;&#x5DF2;&#x5B58;&#x5728;<code>std::thread</code>&#x5BF9;&#x8C61;&#x7684;&#x6240;&#x6709;&#x6743;&#xFF0C;&#x8F6C;&#x79FB;&#x5230;&#x65B0;&#x521B;&#x5EFA;&#x7684;&#x5BF9;&#x8C61;&#x4E2D;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>thread(thread&amp;&amp; other) noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x6784;&#x9020;&#x4E00;&#x4E2A;<code>std::thread</code>&#x5B9E;&#x4F8B;&#x3002;&#x4E0E;other&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x7684;&#x6240;&#x6709;&#x6743;&#xFF0C;&#x5C06;&#x8F6C;&#x79FB;&#x5230;&#x65B0;&#x521B;&#x5EFA;&#x7684;<code>std::thread</code>&#x5BF9;&#x8C61;&#x4E0A;&#x3002;&#x5426;&#x5219;&#xFF0C;&#x65B0;&#x521B;&#x5EFA;&#x7684;<code>std::thread</code>&#x5BF9;&#x8C61;&#x5C06;&#x65E0;&#x4EFB;&#x4F55;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x540E;&#x7F6E;&#x6761;&#x4EF6;</strong>
&#x5BF9;&#x4E8E;&#x4E00;&#x4E2A;&#x65B0;&#x6784;&#x5EFA;&#x7684;<code>std::thread</code>&#x5BF9;&#x8C61;x&#x6765;&#x8BF4;&#xFF0C;x.get_id()&#x7B49;&#x4EF7;&#x4E8E;&#x672A;&#x8F6C;&#x79FB;&#x6240;&#x6709;&#x6743;&#x65F6;&#x7684;other.get_id()&#x3002;get_id()==id()&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<p><strong>NOTE</strong> <code>std::thread</code>&#x5BF9;&#x8C61;&#x662F;&#x4E0D;&#x53EF;CopyConstructible(&#x62F7;&#x8D1D;&#x6784;&#x9020;)&#xFF0C;&#x6240;&#x4EE5;&#x8BE5;&#x7C7B;&#x6CA1;&#x6709;&#x62F7;&#x8D1D;&#x6784;&#x9020;&#x51FD;&#x6570;&#xFF0C;&#x53EA;&#x6709;&#x79FB;&#x52A8;&#x6784;&#x9020;&#x51FD;&#x6570;&#x3002;</p>
<h3 id="stdthread-&#x6790;&#x6784;&#x51FD;&#x6570;">std::thread &#x6790;&#x6784;&#x51FD;&#x6570;</h3>
<p>&#x9500;&#x6BC1;<code>std::thread</code>&#x5BF9;&#x8C61;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>~thread();
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x9500;&#x6BC1;<code>*this</code>&#x3002;&#x5F53;<code>*this</code>&#x4E0E;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x76F8;&#x5173;(this-&gt;joinable()&#x5C06;&#x8FD4;&#x56DE;true)&#xFF0C;&#x8C03;&#x7528;<code>std::terminate()</code>&#x6765;&#x7EC8;&#x6B62;&#x7A0B;&#x5E8F;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="stdthread-&#x79FB;&#x52A8;&#x8D4B;&#x503C;&#x64CD;&#x4F5C;">std::thread &#x79FB;&#x52A8;&#x8D4B;&#x503C;&#x64CD;&#x4F5C;</h3>
<p>&#x5C06;&#x4E00;&#x4E2A;<code>std::thread</code>&#x7684;&#x6240;&#x6709;&#x6743;&#xFF0C;&#x8F6C;&#x79FB;&#x5230;&#x53E6;&#x4E00;&#x4E2A;<code>std::thread</code>&#x5BF9;&#x8C61;&#x4E0A;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>thread&amp; operator=(thread&amp;&amp; other) noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x5728;&#x8C03;&#x7528;&#x8BE5;&#x51FD;&#x6570;&#x524D;&#xFF0C;this-&gt;joinable&#x8FD4;&#x56DE;true&#xFF0C;&#x5219;&#x8C03;&#x7528;<code>std::terminate()</code>&#x6765;&#x7EC8;&#x6B62;&#x7A0B;&#x5E8F;&#x3002;&#x5F53;other&#x5728;&#x6267;&#x884C;&#x8D4B;&#x503C;&#x524D;&#xFF0C;&#x5177;&#x6709;&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#xFF0C;&#x90A3;&#x4E48;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x73B0;&#x5728;&#x5C31;&#x4E0E;<code>*this</code>&#x76F8;&#x5173;&#x8054;&#x3002;&#x5426;&#x5219;&#xFF0C;<code>*this</code>&#x65E0;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x540E;&#x7F6E;&#x6761;&#x4EF6;</strong>
this-&gt;get_id()&#x7684;&#x503C;&#x7B49;&#x4E8E;&#x8C03;&#x7528;&#x8BE5;&#x51FD;&#x6570;&#x524D;&#x7684;other.get_id()&#x3002;oter.get_id()==id()&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<p><strong>NOTE</strong> <code>std::thread</code>&#x5BF9;&#x8C61;&#x662F;&#x4E0D;&#x53EF;CopyAssignable(&#x62F7;&#x8D1D;&#x8D4B;&#x503C;)&#xFF0C;&#x6240;&#x4EE5;&#x8BE5;&#x7C7B;&#x6CA1;&#x6709;&#x62F7;&#x8D1D;&#x8D4B;&#x503C;&#x51FD;&#x6570;&#xFF0C;&#x53EA;&#x6709;&#x79FB;&#x52A8;&#x8D4B;&#x503C;&#x51FD;&#x6570;&#x3002;</p>
<h3 id="stdthreadswap-&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::swap &#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x5C06;&#x4E24;&#x4E2A;<code>std::thread</code>&#x5BF9;&#x8C61;&#x7684;&#x6240;&#x6709;&#x6743;&#x8FDB;&#x884C;&#x4EA4;&#x6362;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>void swap(thread&amp; other) noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x5F53;other&#x5728;&#x6267;&#x884C;&#x8D4B;&#x503C;&#x524D;&#xFF0C;&#x5177;&#x6709;&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#xFF0C;&#x90A3;&#x4E48;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x73B0;&#x5728;&#x5C31;&#x4E0E;<code>*this</code>&#x76F8;&#x5173;&#x8054;&#x3002;&#x5426;&#x5219;&#xFF0C;<code>*this</code>&#x65E0;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;&#x5BF9;&#x4E8E;<code>*this</code>&#x4E5F;&#x662F;&#x4E00;&#x6837;&#x3002;</p>
<p><strong>&#x540E;&#x7F6E;&#x6761;&#x4EF6;</strong>
this-&gt;get_id()&#x7684;&#x503C;&#x7B49;&#x4E8E;&#x8C03;&#x7528;&#x8BE5;&#x51FD;&#x6570;&#x524D;&#x7684;other.get_id()&#x3002;other.get_id()&#x7684;&#x503C;&#x7B49;&#x4E8E;&#x6CA1;&#x6709;&#x8C03;&#x7528;&#x51FD;&#x6570;&#x524D;this-&gt;get_id()&#x7684;&#x503C;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="stdthread&#x7684;&#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;swap">std::thread&#x7684;&#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;swap</h3>
<p>&#x5C06;&#x4E24;&#x4E2A;<code>std::thread</code>&#x5BF9;&#x8C61;&#x7684;&#x6240;&#x6709;&#x6743;&#x8FDB;&#x884C;&#x4EA4;&#x6362;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>void swap(thread&amp; lhs,thread&amp; rhs) noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
lhs.swap(rhs)</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="stdthreadjoinable-&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::joinable &#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x67E5;&#x8BE2;*this&#x662F;&#x5426;&#x5177;&#x6709;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>bool joinable() const noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
&#x5982;&#x679C;*this&#x5177;&#x6709;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#xFF0C;&#x5219;&#x8FD4;&#x56DE;true&#xFF1B;&#x5426;&#x5219;&#xFF0C;&#x8FD4;&#x56DE;false&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="stdthreadjoin-&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::join &#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x7B49;&#x5F85;*this&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x7ED3;&#x675F;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>void join();
</code></pre><p><strong>&#x5148;&#x51B3;&#x6761;&#x4EF6;</strong>
this-&gt;joinable()&#x8FD4;&#x56DE;true&#x3002;</p>
<p><strong>&#x6548;&#x679C;</strong>
&#x963B;&#x585E;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#xFF0C;&#x76F4;&#x5230;&#x4E0E;*this&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x6267;&#x884C;&#x7ED3;&#x675F;&#x3002;</p>
<p><strong>&#x540E;&#x7F6E;&#x6761;&#x4EF6;</strong>
this-&gt;get_id()==id()&#x3002;&#x4E0E;*this&#x5148;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x5C06;&#x5728;&#x8BE5;&#x51FD;&#x6570;&#x8C03;&#x7528;&#x540E;&#x7ED3;&#x675F;&#x3002;</p>
<p><strong>&#x540C;&#x6B65;</strong>
&#x60F3;&#x8981;&#x5728;*this&#x4E0A;&#x6210;&#x529F;&#x7684;&#x8C03;&#x7528;&#x8BE5;&#x51FD;&#x6570;&#xFF0C;&#x5219;&#x9700;&#x8981;&#x4F9D;&#x8D56;&#x6709;joinable()&#x7684;&#x8FD4;&#x56DE;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x5F53;&#x6548;&#x679C;&#x6CA1;&#x6709;&#x8FBE;&#x5230;&#x6216;this-&gt;joinable()&#x8FD4;&#x56DE;false&#xFF0C;&#x5219;&#x629B;&#x51FA;<code>std::system_error</code>&#x5F02;&#x5E38;&#x3002;</p>
<h3 id="stdthreaddetach-&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::detach &#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x5C06;*this&#x4E0A;&#x7684;&#x76F8;&#x5173;&#x7EBF;&#x7A0B;&#x8FDB;&#x884C;&#x5206;&#x79BB;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>void detach();
</code></pre><p><strong>&#x5148;&#x51B3;&#x6761;&#x4EF6;</strong>
this-&gt;joinable()&#x8FD4;&#x56DE;true&#x3002;</p>
<p><strong>&#x6548;&#x679C;</strong>
&#x5C06;*this&#x4E0A;&#x7684;&#x76F8;&#x5173;&#x7EBF;&#x7A0B;&#x8FDB;&#x884C;&#x5206;&#x79BB;&#x3002;</p>
<p><strong>&#x540E;&#x7F6E;&#x6761;&#x4EF6;</strong>
this-&gt;get_id()==id(), this-&gt;joinable()==false</p>
<p>&#x4E0E;*this&#x76F8;&#x5173;&#x7684;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x5728;&#x8C03;&#x7528;&#x8BE5;&#x51FD;&#x6570;&#x540E;&#x5C31;&#x4F1A;&#x5206;&#x79BB;&#xFF0C;&#x5E76;&#x4E14;&#x4E0D;&#x5728;&#x4F1A;&#x4E0E;&#x5F53;&#x524D;<code>std::thread</code>&#x5BF9;&#x8C61;&#x518D;&#x76F8;&#x5173;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x5F53;&#x6548;&#x679C;&#x6CA1;&#x6709;&#x8FBE;&#x5230;&#x6216;this-&gt;joinable()&#x8FD4;&#x56DE;false&#xFF0C;&#x5219;&#x629B;&#x51FA;<code>std::system_error</code>&#x5F02;&#x5E38;&#x3002;</p>
<h3 id="stdthreadgetid-&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::get_id &#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x8FD4;&#x56DE;<code>std::thread::id</code>&#x7684;&#x503C;&#x6765;&#x8868;&#x793A;*this&#x4E0A;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>thread::id get_id() const noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
&#x5F53;*this&#x5177;&#x6709;&#x76F8;&#x5173;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#xFF0C;&#x5C06;&#x8FD4;&#x56DE;<code>std::thread::id</code>&#x4F5C;&#x4E3A;&#x8BC6;&#x522B;&#x5F53;&#x524D;&#x51FD;&#x6570;&#x7684;&#x4F9D;&#x636E;&#x3002;&#x5426;&#x5219;&#xFF0C;&#x8FD4;&#x56DE;&#x9ED8;&#x8BA4;&#x6784;&#x9020;&#x7684;<code>std::thread::id</code>&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="stdthreadhardwareconcurrency-&#x9759;&#x6001;&#x6210;&#x5458;&#x51FD;&#x6570;">std::thread::hardware_concurrency &#x9759;&#x6001;&#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x8FD4;&#x56DE;&#x786C;&#x4EF6;&#x4E0A;&#x53EF;&#x4EE5;&#x5E76;&#x53D1;&#x7EBF;&#x7A0B;&#x7684;&#x6570;&#x91CF;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>unsigned hardware_concurrency() noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
&#x786C;&#x4EF6;&#x4E0A;&#x53EF;&#x4EE5;&#x5E76;&#x53D1;&#x7EBF;&#x7A0B;&#x7684;&#x6570;&#x91CF;&#x3002;&#x8FD9;&#x4E2A;&#x503C;&#x53EF;&#x80FD;&#x662F;&#x7CFB;&#x7EDF;&#x5904;&#x7406;&#x5668;&#x7684;&#x6570;&#x91CF;&#x3002;&#x5F53;&#x4FE1;&#x606F;&#x4E0D;&#x7528;&#x6216;&#x53EA;&#x6709;&#x5B9A;&#x4E49;&#xFF0C;&#x5219;&#x8BE5;&#x51FD;&#x6570;&#x8FD4;&#x56DE;0&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h2 id="d72-thisthread&#x547D;&#x540D;&#x7A7A;&#x95F4;">D.7.2 this_thread&#x547D;&#x540D;&#x7A7A;&#x95F4;</h2>
<p>&#x8FD9;&#x91CC;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B;<code>std::this_thread</code>&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x5185;&#x63D0;&#x4F9B;&#x7684;&#x51FD;&#x6570;&#x64CD;&#x4F5C;&#x3002;</p>
<h3 id="thisthreadgetid-&#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;">this_thread::get_id &#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x8FD4;&#x56DE;<code>std::thread::id</code>&#x7528;&#x6765;&#x8BC6;&#x522B;&#x5F53;&#x524D;&#x6267;&#x884C;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>thread::id get_id() noexcept;
</code></pre><p><strong>&#x8FD4;&#x56DE;</strong>
&#x53EF;&#x901A;&#x8FC7;<code>std:thread::id</code>&#x6765;&#x8BC6;&#x522B;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="thisthreadyield-&#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;">this_thread::yield &#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x8BE5;&#x51FD;&#x6570;&#x7528;&#x4E8E;&#x901A;&#x77E5;&#x5E93;&#xFF0C;&#x8C03;&#x7528;&#x7EBF;&#x7A0B;&#x4E0D;&#x9700;&#x8981;&#x7ACB;&#x5373;&#x8FD0;&#x884C;&#x3002;&#x4E00;&#x822C;&#x4F7F;&#x7528;&#x5C0F;&#x5FAA;&#x73AF;&#x6765;&#x907F;&#x514D;&#x6D88;&#x8017;&#x8FC7;&#x591A;CPU&#x65F6;&#x95F4;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>void yield() noexcept;
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x4F7F;&#x7528;&#x6807;&#x51C6;&#x5E93;&#x7684;&#x5B9E;&#x73B0;&#x6765;&#x5B89;&#x6392;&#x7EBF;&#x7A0B;&#x7684;&#x4E00;&#x4E9B;&#x4E8B;&#x60C5;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="thisthreadsleepfor-&#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;">this_thread::sleep_for &#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x5728;&#x6307;&#x5B9A;&#x7684;&#x6307;&#x5B9A;&#x65F6;&#x957F;&#x5185;&#xFF0C;&#x6682;&#x505C;&#x6267;&#x884C;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>template&lt;typename Rep,typename Period&gt;
void sleep_for(std::chrono::duration&lt;Rep,Period&gt; const&amp; relative_time);
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x5728;&#x8D85;&#x51FA;relative_time&#x7684;&#x65F6;&#x957F;&#x5185;&#xFF0C;&#x963B;&#x585E;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x3002;</p>
<p><strong>NOTE</strong> &#x7EBF;&#x7A0B;&#x53EF;&#x80FD;&#x963B;&#x585E;&#x7684;&#x65F6;&#x95F4;&#x8981;&#x957F;&#x4E8E;&#x6307;&#x5B9A;&#x65F6;&#x957F;&#x3002;&#x5982;&#x679C;&#x53EF;&#x80FD;&#xFF0C;&#x901D;&#x53BB;&#x7684;&#x65F6;&#x95F4;&#x7531;&#x5C06;&#x4F1A;&#x7531;&#x4E00;&#x4E2A;&#x7A33;&#x5B9A;&#x65F6;&#x949F;&#x51B3;&#x5B9A;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>
<h3 id="thisthreadsleepuntil-&#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;">this_thread::sleep_until &#x975E;&#x6210;&#x5458;&#x51FD;&#x6570;</h3>
<p>&#x6682;&#x505C;&#x6307;&#x5B9A;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#xFF0C;&#x76F4;&#x5230;&#x5230;&#x4E86;&#x6307;&#x5B9A;&#x7684;&#x65F6;&#x95F4;&#x70B9;&#x3002;</p>
<p><strong>&#x58F0;&#x660E;</strong></p>
<pre><code>template&lt;typename Clock,typename Duration&gt;
void sleep_until(
    std::chrono::time_point&lt;Clock,Duration&gt; const&amp; absolute_time);
</code></pre><p><strong>&#x6548;&#x679C;</strong>
&#x5728;&#x5230;&#x8FBE;absolute_time&#x7684;&#x65F6;&#x95F4;&#x70B9;&#x524D;&#xFF0C;&#x963B;&#x585E;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#xFF0C;&#x8FD9;&#x4E2A;&#x65F6;&#x95F4;&#x70B9;&#x7531;&#x6307;&#x5B9A;&#x7684;Clock&#x51B3;&#x5B9A;&#x3002;</p>
<p><strong>NOTE</strong> &#x8FD9;&#x91CC;&#x4E0D;&#x4FDD;&#x8BC1;&#x4F1A;&#x963B;&#x585E;&#x591A;&#x957F;&#x65F6;&#x95F4;&#xFF0C;&#x53EA;&#x6709;Clock::now()&#x8FD4;&#x56DE;&#x7684;&#x65F6;&#x95F4;&#x7B49;&#x4E8E;&#x6216;&#x5927;&#x4E8E;absolute_time&#x65F6;&#xFF0C;&#x963B;&#x585E;&#x7684;&#x7EBF;&#x7A0B;&#x624D;&#x80FD;&#x88AB;&#x89E3;&#x9664;&#x963B;&#x585E;&#x3002;</p>
<p><strong>&#x629B;&#x51FA;</strong>
&#x65E0;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="D.6-chinese.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: D.6 ratio头文件">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"D.7 thread头文件","level":"1.22.7","depth":2,"previous":{"title":"D.6 ratio头文件","level":"1.22.6","depth":2,"path":"content/appendix_D/D.6-chinese.md","ref":"content/appendix_D/D.6-chinese.md","articles":[]},"dir":"ltr"},"config":{"plugins":["livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"plugins":["katex","ace"],"livereload":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"fontSettings":{"theme":"white","family":"msyh","size":2},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"陈晓伟 chenxiaowei","pdf":{"pageNumbers":false,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":10,"left":10,"top":10,"bottom":20}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"C++并发编程实战（第2版）","language":"zh-hans","gitbook":"*","description":"《C++ Concurrency In Action - SECOND EDITION》英文版的中文翻译版。","direction":"ltr"},"file":{"path":"content/appendix_D/D.7-chinese.md","mtime":"2022-11-19T02:54:31.289Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-11-19T07:50:48.148Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

